import { createApp } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'
// 引入路由拦截器
import '@/router/permission'
// 自定义全局指令
import { directive } from '@/directive'

// 整合 ElementPlus
import ElementPlus from 'element-plus'
// 汉化
import locale from 'element-plus/es/locale/lang/zh-cn'
// 样式文件
import '@/styles/index.scss'
// 图标
import { useEleIcon } from '@/utils/setGlobal'

const app = createApp(App)

app.use(createPinia())
app.use(router)
app.use(ElementPlus, {locale})
// 全局注册图标 'ele-' 开头
useEleIcon(app)

// 注册自定义全局指令
directive(app)

app.mount('#app')
